package com.flyone.fuxiao.controller;

import com.flyone.fuxiao.model.entity.Music;
import com.flyone.fuxiao.service.MusicService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: text-to-picture
 * @ClassName: MusicController
 * @description: 音乐控制器
 * @author: banyun
 * @create: 2024-04-19 20:27
 */
@Api(tags = "音乐唱片")
@Slf4j
@RequestMapping("/music")
@RestController
public class MusicController {
    private final MusicService musicService;

    @Autowired
    public MusicController(MusicService musicService) {
        this.musicService = musicService;
    }

    @GetMapping("/{id}")
    public Music getMusic(@PathVariable int id) {
        return musicService.getMusic(id);
    }
}

